package dk.aiszone.lang.autosource.generatorobjects.interfaces;

import java.util.List;

/**
 * Interface implemented by objects containing a body.
 * 
 * @author Ais
 */
public interface BodyContainer extends Cloneable {

    /**
     * Append a <code>BlockObject</code> part to the body
     * 
     * @param part
     *            The part to add
     * @return Returns the <code>BodyContainer</code> instance to which the part has been appended.
     */
    public abstract BodyContainer appendToBody(BodyContainer part);

    /**
     * Append a <code>boolean</code> part to the body
     * 
     * @param part
     *            The part to add
     * @return Returns the <code>BodyContainer</code> instance to which the part has been appended.
     */
    public abstract BodyContainer appendToBody(boolean part);

    /**
     * Append a <code>int</code> part to the body
     * 
     * @param part
     *            The part to add
     * @return Returns the <code>BodyContainer</code> instance to which the part has been appended.
     */
    public abstract BodyContainer appendToBody(int part);

    /**
     * Append a <code>BlockObject</code> part to the body
     * 
     * @param part
     *            The part to add
     * @return Returns the <code>BodyContainer</code> instance to which the part has been appended.
     */
    public abstract BodyContainer appendToBody(SimpleBlockObject part);

    /**
     * Append a <code>String</code> part to the body
     * 
     * @param part
     *            The part to add
     * @return Returns the <code>BodyContainer</code> instance to which the part has been appended.
     */
    public abstract BodyContainer appendToBody(String part);

    /**
     * Append a <code>StringBuilder</code> part to the body
     * 
     * @param part
     *            The part to add
     * @return Returns the <code>BodyContainer</code> instance to which the part has been appended.
     */
    public abstract BodyContainer appendToBody(StringBuilder part);

    /**
     * Append an end part to the <code>BodyContainer</code>.<br>
     * An end part is appended to the {@link BodyContainer#getBodyParts()} when called.
     * 
     * @param endPart
     *            The end part to add
     * @return Returns the <code>BodyContainer</code> instance to which the part has been appended.
     */
    public abstract BodyContainer appendToBodyEnd(String endPart);

    /**
     * Clone the <code>BodyContainer</code>.
     * 
     * @return The created clone.
     */
    public abstract Object clone();

    /**
     * Retrieve the body.
     * 
     * @return <code>List</code> containing the elements which represent the body.
     */
    public abstract List<SimpleBlockObject> getBodyParts();

    /**
     * Retrieve whether the <code>BodyContainer</code> is empty.
     * 
     * @return <code>true</code> if empty - otherwise <code>false</code>.
     */
    public abstract boolean isBodyEmpty();
}